<%@ Page Language="c#" ContentType="image/jpeg"%>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<%@ Import Namespace="System.Net" %>
<%
short nQuality = 45;
System.Net.WebClient myWebClient = new System.Net.WebClient();
System.IO.Stream myStream = myWebClient.OpenRead(Request.QueryString["url"].ToString());
//System.IO.StreamReader sr = new System.IO.StreamReader(myStream);
//string str = sr.ReadToEnd();
Bitmap m_image = new Bitmap(myStream);
Graphics g = Graphics.FromImage( m_image );
//Get codecs
	ImageCodecInfo[] icf = ImageCodecInfo.GetImageEncoders();

	EncoderParameters encps = new EncoderParameters( 1 );
	EncoderParameter encp = new EncoderParameter( System.Drawing.Imaging.Encoder.Quality, (long) nQuality );

	//Set quality
	encps.Param[0] = encp;

	m_image.Save( Response.OutputStream, icf[1], encps );

//Response.Write(str);
//myStream.Close();
%>